<template>
  <div class="work">
    <div class="icon-list">
      <div v-for="(a, b) in sortList" :key="b" @click="goPath(a)">
        <div :class="'iconfont icon-' + a.icon" :style="{ backgroundColor: a.color }"></div>
        <div class="word">{{ a.title }}</div>
      </div>
    </div>
  </div>
</template>

<script setup>
import system from '@/utils/system';
import { onMounted, ref } from 'vue';
import { queryData } from '@/apis/mysql'
const sortList = ref([])
onMounted(() => {
  // document.title = '软件'
  getList()
})
function goPath(x) {
  system.openFile(x.start)
}
function getList() {
  queryData({
    table: 'softs',
    data: {},
    query: {
      page: 1,
      show: 100
    }
  }).then(res => {
    const arr = []
    res.data.map((x, y) => {
      arr.push(x)
    })
    sortList.value = arr
    // console.log(arr)
  })
}
</script>
<style scoped lang="scss">
.work {
  padding: 10px 0;

  h2 {
    margin: 20px;
  }
}
</style>
